package com.hmdp.config;

import com.github.benmanes.caffeine.cache.Cache;
import com.github.benmanes.caffeine.cache.Caffeine;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

//jvm缓存(进程缓存)，caffeine实现
@Configuration
public class CaffeineConfig {
    @Bean
    public Cache<Long,Object> cache(){
        return Caffeine.newBuilder().initialCapacity(100).maximumSize(10_000).build();    }
}
